﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Cgd.Shell.Data;

public partial class Tech : System.Web.UI.Page
{
	protected void Page_Load(object sender, EventArgs e)
	{
		((CgdShellMasterPage)this.Master).SetActiveNavButton("navTech");

		using(CgdShellDataContext db = new CgdShellDataContext())
		{
			lstHeadline.DataSource = (from h in db.Documents
									  where h.Category == CgdColumn.TechHeadline.Value
									  orderby h.Time descending
									  select h).Take(2);
			lstHeadline.DataBind();

			lstPop.DataSource = (from h in db.Documents
								 where h.Category == CgdColumn.TechPop.Value
								 orderby h.Time descending
								 select h).Take(10);
			lstPop.DataBind();

			lstUpdate.DataSource = (from h in db.Documents
									where h.Category == CgdColumn.TechUpdates.Value
									orderby h.Time descending
									select h).Take(10);
			lstUpdate.DataBind();
		}
	}
}
